unit ufCustomSetupFrame;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
  Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.StdCtrls;


type

  TfCustomSetupFrame = class(TFrame)
    iTop: TImage;
  private
    FButton: TLabel;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;

    procedure Prepare(); virtual; abstract;
    procedure BeforClose(); virtual; abstract;
    function CanClose(): boolean; virtual;
    procedure Refresh(); virtual; abstract;
    procedure FormHidded(); virtual;
    procedure Activate(); virtual; abstract;

    procedure CheckEmpty(Edit: TCustomEdit; const ParamName: string);

    property Button: TLabel read FButton write FButton;
  end;

  TfCustomSetupFrameClass = class of TfCustomSetupFrame;


implementation

{$R *.dfm}

uses uformDataModule;



{ TfCustomSetupFrame }

function TfCustomSetupFrame.CanClose: boolean;
begin
  result:= True;
end;

procedure TfCustomSetupFrame.CheckEmpty(Edit: TCustomEdit; const ParamName: string);
begin
  if trim(Edit.Text) = EmptyStr then begin
    Edit.SetFocus;
    raise Exception.CreateFmt(sServerForm_1, [ParamName]);
  end;
end;

constructor TfCustomSetupFrame.Create(AOwner: TComponent);
begin
  inherited;
  FButton:= nil;
end;

destructor TfCustomSetupFrame.Destroy;
begin

  inherited;
end;

procedure TfCustomSetupFrame.FormHidded;
begin

end;

end.
